﻿package cgs.server.logging.actions
{

    public class ClientAction extends Object implements IClientAction
    {
        protected var _isBufferable:Boolean = true;
        protected var _aid:int;
        protected var _startTick:uint;
        protected var _endTick:uint;
        protected var _statusID:uint;
        private var _detailObject:Object;
        private var _actionObject:Object;

        public function ClientAction(param1:int = 0, param2:int = 0, param3:int = 0, param4:int = 0)
        {
            this._aid = param1;
            this._startTick = param2;
            this._endTick = param3;
            this._statusID = param4;
            this._actionObject = {};
            this.setActionID(param1);
            this.setStartTimeStamp(param2);
            this.setEndTimeStamp(param3);
            this.setStatusID(param4);
            return;
        }// end function

        public function addProperty(param1:String, param2) : void
        {
            this._actionObject[param1] = param2;
            return;
        }// end function

        public function addDetailProperty(param1:String, param2) : void
        {
            if (this._detailObject == null)
            {
                this._detailObject = {};
                this.addProperty("detail", this._detailObject);
            }
            this._detailObject[param1] = param2;
            return;
        }// end function

        public function get detailObject() : Object
        {
            return this._detailObject;
        }// end function

        public function isBufferable() : Boolean
        {
            return this._isBufferable;
        }// end function

        public function setBufferable(param1:Boolean) : void
        {
            this._isBufferable = param1;
            return;
        }// end function

        public function setDetail(param1:Object) : void
        {
            var _loc_2:String = null;
            if (param1 != null)
            {
                for (_loc_2 in param1)
                {
                    
                    this.addDetailProperty(_loc_2, param1[_loc_2]);
                }
            }
            return;
        }// end function

        public function setActionID(param1:int) : void
        {
            this.addProperty("aid", param1);
            return;
        }// end function

        public function setStartTimeStamp(param1:int) : void
        {
            this.addProperty("ts", param1);
            return;
        }// end function

        public function setEndTimeStamp(param1:int) : void
        {
            this.addProperty("te", param1);
            return;
        }// end function

        public function setStatusID(param1:int) : void
        {
            this.addProperty("stid", param1);
            return;
        }// end function

        public function get actionObject() : Object
        {
            return this._actionObject;
        }// end function

    }
}
